package com.rainng.coursesystem.repository;


import com.rainng.coursesystem.model.SubmitHomeworkItem;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;
import java.util.UUID;

@Repository
public interface SubmitHomeworkRepository extends JpaRepository<SubmitHomeworkItem, UUID> {

    List<SubmitHomeworkItem> findAllByHomeworkId(UUID homeworkId);

    SubmitHomeworkItem findAllByHomeworkIdAndUserId(UUID homeworkId,long userId);

    Optional<SubmitHomeworkItem> findByUserIdAndHomeworkId(long userId, UUID homeworkId);
}
